import { createApp } from 'vue'
import Codemirror from 'vue-codemirror'
import { createPinia } from 'pinia'
import router from './router'
import App from './App.vue'
import * as Splitpanes from 'splitpanes'

// 样式文件
import './style.css'

// 创建应用实例
const app = createApp(App)

// 注册全局组件
app.component('Splitpanes', Splitpanes)

// 使用插件
app.use(createPinia())
app.use(router)
app.use(Codemirror)

// 全局错误处理
app.config.errorHandler = (err: unknown, _instance: unknown, info: string) => {
  console.error('全局错误:', err, info)
}

// 挂载应用
app.mount('#app')

